def climb_stairs(n):
    if n == 1 or n == 2:
        return n
    a, b = 1, 2

    for _ in range(3, n + 1):
        a, b = b, a + b
    return b

# 10 = 1 + 2 + 3 + 4 + 5
print(climb_stairs(5))
